package cn.fd.service.impl;

import cn.fd.dao.AccountDao;
import cn.fd.domain.Account;
import cn.fd.service.AccountService;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * @Author 田俊龙
 * @Date 2022/1/7
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;

    @Override
    public List<Account> findAll() throws IOException {
        return accountDao.findAll();
    }

    @Override
    public void save(Account account) throws IOException {
        accountDao.save(account);
    }

    @Override
    public void update(Account account) {
        accountDao.update(account);
    }

    @Override
    public void delete(int id) {
        accountDao.delete(id);
    }

    @Override
    public Account findById(int id) {
        return accountDao.findById(id);
    }

    @Override
    public Account login(Account account) {
        return accountDao.login(account);
    }
}
